#ifndef _QY_TCP_CHANNEL_H
#define _QY_TCP_CHANNEL_H

namespace qy
{


class TCPChannel
{
public:
    TCPChannel(int socket);
	virtual ~TCPChannel();

	void close();

	bool canSend(double timeout = 0.5);
	bool canReceive(double timeout = 0.5);

	int send(const char *data, int size);
	int receive(char *buffer, int size);

private:
	TCPChannel(const TCPChannel &channel) {}
	TCPChannel &operator=(const TCPChannel &channel) {}

protected:
	int m_socket;
};

}

#endif
